package com.zhj.dubbo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.zhj.dubbo.service.HelloService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zhj
 */
@Controller
@RequestMapping("/hello")
public class HelloController {

    @Reference
    private HelloService helloService;

    @RequestMapping (value = "/sayhello", produces = "text/html;charset=UTF-8")
    @ResponseBody
    public String sayHello() {
        String hello = helloService.sayHello("客户端");
        System.out.println(hello);
        return hello;
    }

}
